/**
 * @file factorylib.h
 * \brief Interface for Factory of sdlib (Select Dynamic Library).
 *
 *  Created on: Feb 25, 2012
 *  @author: Francesco Corvino
 */

#ifndef FACTORYLIB_H_
#define FACTORYLIB_H_

#include <stdlib.h>
#include <string.h>

#include "../MemObj/dynArray.h"

#include "proxysdlib.h"
#include "sdlibInterface.h"

#define SDLIB_LENGHTMAX_NAME 30
#define SDLIB_LENGHTMAX_PATH 255
#define SDLIB_NAME_INTERFACEFUN "registerLib"
/**
 *
 */
typedef struct descrFun {
	char *name;
	HANDLER_FUN funpointer;
	int type;
} DescrFun;

/**
 * @brief Struttura dati descrittiva di una libreria caricata in memoria.
 */
typedef struct descrLib {
	char *name;
	char *path;
	HANDLER_LIB libpointer;
	DynArray functions;
} DescrLib;

void SDLIB_init(DynArray * libArr);

DescrLib * SDLIB_create(char * name, char * path);

#endif /* FACTORYLIB_H_ */
